'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const ObjectId = Schema.ObjectId;

  const OrderSubscriptionSchema = new Schema({
    order_id: { type: ObjectId },
    chat_room_id: { type: ObjectId },
    type: { type: String },
    code: { type: String },
    content: { type: String },
    name: { type: String },
    sex: { type: String },
    birthday: { type: String },
    age: { type: String },
    phone: { type: String },
    date: { type: String },
    time: { type: String },
    images: { type: Array },
    expert_id: { type: ObjectId },
    user_id: { type: ObjectId },
    create_at: { type: Date, default: Date.now },
    update_at: { type: Date, default: Date.now },
  });

  return mongoose.model('OrderSubscription', OrderSubscriptionSchema);
};